package com.shiguiwu.springmybatis.spring.createbean;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @description: spring创建bean的方法
 * @author: stone
 * @date: Created by 2021/3/8 17:09
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.createbean
 */
public class SpringCreateBeanTests {

    public static void main(String[] args) {

        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring/createBean.xml");
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        //不同的构造器
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName + ":" + applicationContext.getBean(beanDefinitionName));
        }


    }
}
